package com.missilike.admin.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.missilike.biz.IMilWithdrawRecordService;
import com.missilike.core.result.CommonResult;
import com.missilike.core.utils.ResultUtils;
import com.missilike.domain.response.MilAccountInfo;
import com.missilike.domain.response.MilWithdrawRecordInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kin
 * @since 2019-01-08
 */
@RestController
@RequestMapping("/api/mil/withdraw")
public class MilWithdrawRecordController {

    private final IMilWithdrawRecordService milWithdrawRecordService;

    @Autowired
    public MilWithdrawRecordController(IMilWithdrawRecordService milWithdrawRecordService) {
        this.milWithdrawRecordService = milWithdrawRecordService;
    }


    @RequestMapping(value = "page", method = RequestMethod.GET)
    public CommonResult list(@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
                             @RequestParam(value = "pageSize", required = false, defaultValue = "20") int pageSize,
                             @RequestParam(value = "account", required = false, defaultValue = "") String account) {
        IPage<MilWithdrawRecordInfo> milWithdrawRecordList = milWithdrawRecordService.getList(new Page<>(pageNum, pageSize),account);
        return ResultUtils.ok(milWithdrawRecordList);
    }
}

